﻿@using BE.ModelosIII.Domain
@using BE.ModelosIII.Infrastructure.Helpers
@using BE.ModelosIII.Mvc.Models.Scenario
@using MvcContrib.FluentHtml
@inherits ModelWebViewPage<ScenarioModel>


<fieldset>
    @Html.Hidden("ScenarioId", Model.Id)
    <section class="utopia-widget">
        <div class="utopia-widget-title">
            <span>General</span>
        </div>
        <div class="utopia-widget-content">
            <div class="form-horizontal">
                <div class="control-group">
                    <label class="control-label">
                        Nombre</label>
                    <label class="control-label span4">@Model.Name</label>
                </div>
                <div class="control-group">
                    <label class="control-label">
                        Tamaño de Caja</label>
                    <label class="control-label span4">@Model.BinSize</label>
                </div>
            </div>
        </div>
    </section>
    <section class="utopia-widget">
        <div class="utopia-widget-title">
            <span>Items Disponibles</span>
        </div>
        <div class="utopia-widget-content">
            <div class="form-horizontal">

                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th>Etiqueta</th>
                            <th>Cantidad</th>
                            <th>Tamaño</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model.Items)
                        {
                            <tr>
                                <td>@item.Label</td>
                                <td>@item.Quantity</td>
                                <td>@item.Size</td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </section>
    @Html.Partial("Configuration/_Configuration", Model.Configuration, new ViewDataDictionary(Html.ViewDataContainer.ViewData)
        {
            TemplateInfo = new TemplateInfo { HtmlFieldPrefix = "Configuration" }
        })
    <br />
    <div class="control-group box-last">
        <div class="utopia-form-button">
            <a href="@Url.Action("Index")" class="btn span3">Volver</a>
            <a href="@Url.Action("Index", "Run", new { ScenarioId = Model.Id })" class="btn btn-warning span3">Ver soluciones</a>
            <a data-href="@Url.Action("Run", "Run", new { ScenarioId = Model.Id })" href="javascript:void(0)" class="btn btn-primary span3 runSolution">Encontrar solución</a>
        </div>
    </div>
</fieldset>
